package com.judian.smart.constant;

import java.util.HashMap;

public enum ServiceType {
    WEATHER,
    TRAIN,
    FLIGHT,
    MUSICX,                // 音乐播放&控制
    AIRCONTROL_SMARTH,
    CURTAIN_SMARTH,
    LIGHT_SMARTH,
    FREEZER_SMARTH,
    HUMIDIFIER_SMARTH,        // 加湿器
    NUMBER_MASTER,            // 数字纠错
    CMD,
    CHAT,
    SMARTHOME,                // 智能家居
    TELEPHONE,
    COOKBOOK,
    STORY,
    RADIO,
    JOKE,
    NEWS,
    PM25,
    DATETIME,
    CALC,
    DISHORDER,
    TRANSLATION,
    IDIOM,
    SCHEDULEX,
    MAP,
    BAIKE, CONSTELLATION, ENGLISHEVERYDAY, INTERNETRADIO, MOTORVIOLATION, NUMBERTMASTER, RIDDLE, STOCK, WORDFINDING,
    OPENQA,
    OTHER,
    FORWARDUPDATEANHONG, // 闲聊
    POETRY, FORWARDUPDATEAPK,
    FORWARDVERSIONAPK, FORWARDADDANHONG,
    FORWARDGETANHONG, FORWARDMASTERTINFO,
    FORWARDUPDATEMASTERTINFO, FORWARDDELALLVOICE,
    FORWARDGATEWAY,
    FORWARDADDVOICE, FORWARDVOICEINFO, FORWARDDElVOICE,
    FORWARDADDARCE, // 智能家居
    FORWARDADDDEVICE, FORWARDDELDEVICE, FORWARDSUBSCRIBEINFO,
    FORWARDDELSUBSCRIBEINFO, FORWARDADDSUBSCRIBEINFO, FORWARDDELMODE, FORWARDDELMODELIST,
    FORWARDNAMECONTROL, FORWARDGETDEVICE, FORWARDGETMODELIST,
    FORWARDUPDATEMODE, FORWARDGETMODE, FORWARDUPDATEEVICE,
    FORWARDDELALLDEVICE, FORWARDADDMODE, FORWARDADDMODELIST,
    FORWARDSONG, LOGIN, CONNECT, FORWARDUPDATEVERSION,
    FORWARD, LINE, CLOUDRESPONSE, FORWARDADDREDINFRA;
    static HashMap<String, ServiceType> serviceMap = new HashMap<>();

    static {
        serviceMap.put("weather", WEATHER);
        serviceMap.put("train", TRAIN);
        serviceMap.put("flight", FLIGHT);
        serviceMap.put("musicX", MUSICX);
        serviceMap.put("airControl_smartHome", AIRCONTROL_SMARTH);
        serviceMap.put("curtain_smartHome", CURTAIN_SMARTH);
        serviceMap.put("light_smartHome", LIGHT_SMARTH);
        serviceMap.put("humidifier_smartHome", HUMIDIFIER_SMARTH);
        serviceMap.put("freezer_smartHome", FREEZER_SMARTH);
        serviceMap.put("numberMaster", NUMBER_MASTER);
        serviceMap.put("smartHome", SMARTHOME);
        serviceMap.put("dishOrder", DISHORDER);
        serviceMap.put("telephone", TELEPHONE);
        serviceMap.put("story", STORY);
        serviceMap.put("news", NEWS);
        serviceMap.put("joke", JOKE);
        serviceMap.put("cmd", CMD);
        serviceMap.put("radio", RADIO);
        serviceMap.put("datetime", DATETIME);
        serviceMap.put("calc", CALC);
        serviceMap.put("pm25", PM25);
        serviceMap.put("translation", TRANSLATION);
        serviceMap.put("idiom", IDIOM);
        serviceMap.put("scheduleX", SCHEDULEX);
        serviceMap.put("mapU", MAP);
        serviceMap.put("poetry", POETRY);
        serviceMap.put("ForwardGateWay", FORWARDGATEWAY);

        serviceMap.put("baike", BAIKE);
        serviceMap.put("constellation", CONSTELLATION);
        serviceMap.put("cookbook", COOKBOOK);
        serviceMap.put("englishEveryday", ENGLISHEVERYDAY);
        serviceMap.put("internetRadio", INTERNETRADIO);
        serviceMap.put("motorViolation", MOTORVIOLATION);
        serviceMap.put("numbertMaster", NUMBERTMASTER);
        serviceMap.put("riddle", RIDDLE);
        serviceMap.put("stock", STOCK);
        serviceMap.put("wordFinding", WORDFINDING);
        serviceMap.put("openQA", OPENQA);
        serviceMap.put("other", OTHER);
        //DST
        serviceMap
                .put("ForwardSubscribeInfo", ServiceType.FORWARDSUBSCRIBEINFO);
        serviceMap.put("ForwardDelSubscribe",
                ServiceType.FORWARDDELSUBSCRIBEINFO);
        serviceMap.put("ForwardAddSubscribe",
                ServiceType.FORWARDADDSUBSCRIBEINFO);
        serviceMap.put("ForwardAddArce", ServiceType.FORWARDADDARCE);
        serviceMap.put("ForwardMasterInfo", ServiceType.FORWARDMASTERTINFO);
        serviceMap.put("ForwardUpMasterInfo",
                ServiceType.FORWARDUPDATEMASTERTINFO);
        serviceMap.put("ForwardUpdateAnHong", ServiceType.FORWARDUPDATEANHONG);
        serviceMap.put("ForwardGetAnHong", ServiceType.FORWARDGETANHONG);
        serviceMap.put("ForwardGetMode", ServiceType.FORWARDGETMODE);
        serviceMap.put("ForwardUpdateMode", ServiceType.FORWARDUPDATEMODE);
        serviceMap.put("ForwardSong", ServiceType.FORWARDSONG);

        serviceMap.put("ForwardGetModeList", ServiceType.FORWARDGETMODELIST);
        serviceMap
                .put("ForwardUpdateVersion", ServiceType.FORWARDUPDATEVERSION);
        serviceMap.put("ForwardAddAnHong", ServiceType.FORWARDADDANHONG);
        serviceMap.put("ForwardDelAllVoice", ServiceType.FORWARDDELALLVOICE);
        serviceMap.put("ForwardUpdateApk", ServiceType.FORWARDUPDATEAPK);
        serviceMap.put("ForwardVersionApk", ServiceType.FORWARDVERSIONAPK);
        serviceMap.put("ForwardAddVoice", ServiceType.FORWARDADDVOICE);
        serviceMap.put("ForwardVoiceInfo", ServiceType.FORWARDVOICEINFO);
        serviceMap.put("ForwardDelVoice", ServiceType.FORWARDDElVOICE);
        serviceMap.put("ForwardAddRedInFra", ServiceType.FORWARDADDREDINFRA);
        serviceMap.put("ForwardAddModeList", ServiceType.FORWARDADDMODELIST);
        serviceMap.put("ForwardUpdateDevice", ServiceType.FORWARDUPDATEEVICE);
        serviceMap.put("ForwardNameControl", ServiceType.FORWARDNAMECONTROL);
        serviceMap.put("ForwardGetDevice", ServiceType.FORWARDGETDEVICE);
        serviceMap.put("ForwardDelAllDevice", ServiceType.FORWARDDELALLDEVICE);
        serviceMap.put("ForwardAddDevice", ServiceType.FORWARDADDDEVICE);
        serviceMap.put("ForwardAddMode", ServiceType.FORWARDADDMODE);
        serviceMap.put("ForwardDelDevice", ServiceType.FORWARDDELDEVICE);
        serviceMap.put("ForwardDelMode", ServiceType.FORWARDDELMODE);
        serviceMap.put("ForwardDelModeList", ServiceType.FORWARDDELMODELIST);
        serviceMap.put("Login", ServiceType.LOGIN);
        serviceMap.put("Connect", ServiceType.CONNECT);
        serviceMap.put("CloudResponse", ServiceType.CLOUDRESPONSE);
        serviceMap.put("Forward", ServiceType.FORWARD);
        serviceMap.put("Line", ServiceType.LINE);
    }

    public static ServiceType getServiceType(String service) {
        ServiceType type = serviceMap.get(service);
        if (null == type) {
            type = ServiceType.OTHER;
        }
        return type;
    }
}
